<?php
namespace app\model;

use plugin\admin\app\common\Tree;
use const support\CORRECT;

class GoodsCateModel extends BaseModel{

    protected $table = 'rl_goods_cates';

    //获取树状信息
    public function selectTree(): ?array
    {
        $lists=GoodsCateModel::where([
            'status'=>CORRECT
        ])->select(['id','cate_title','cate_id'])->get()->toArray();
        $tree = new Tree($lists,'cate_id');
        return $tree->getTree();
    }

}